<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="border-hover-style" style="display: flex">
      <div
        class="content-parent"
        :style="{
          backgroundImage:
            !props.info.value && !props.info.subTitle && !props.info.remarks
              ? `url(${publicUrls + 'free/style12/Level2outlineStyle2Bg2.webp'})`
              : `url(${publicUrls + 'free/style12/Level2outlineStyle2Bg.webp'})`,
        }"
      >
        <div class="digitalShowroom-p" v-if="props.info.digitalShowroom">
          <digitalShowroomIcon :url="props.info.digitalShowroom" />
        </div>
        <div
          class="content"
          :class="{
            content3: !props.info.value && props.info.subTitle && !props.info.remarks,
            content2: !props.info.value && !props.info.subTitle && !props.info.remarks,
          }"
        >
          <div
            class="title-box"
            :class="{ 'title-box-2': props.info.text.length > 9 }"
            :style="{
              backgroundImage: `url(${publicUrls + 'free/style12/Level2outlineStyle2Bgtitle.webp'})`,
            }"
          >
            <p>{{ props.info.text }}</p>
          </div>
          <div
            :style="{
              backgroundImage: `url(${publicUrls + 'free/style12/Level2outlineStyle2Bgshadow.webp'})`,
            }"
            class="content-right-no"
            v-if="!props.info.value && !props.info.subTitle && !props.info.remarks"
          ></div>
          <div class="content-right" v-else>
            <p class="subtitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>

            <div
              class="img-box"
              :class="{
                'img-box1': props.info.remarks && !props.info.subTitle,
                'img-box2': !props.info.remarks && props.info.subTitle,
                'img-box3': !props.info.remarks && !props.info.subTitle,
              }"
              v-if="props.info.value"
            >
              <div class="outline-cover">
                <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
              </div>
            </div>
            <div class="remarks1" v-if="props.info.value">
              <TextMax
                :infoData="props.info"
                v-if="props.domShow"
                :data="props.info.remarks"
                :title="props.info.text"
                :row="3"
              ></TextMax>
            </div>
            <div
              class="remarks2"
              :class="{
                remarks3: !props.info.subTitle,
              }"
              v-else-if="props.info.remarks"
            >
              <TextMax
                :infoData="props.info"
                v-if="props.domShow"
                :data="props.info.remarks"
                :title="props.info.text"
                :row="props.info.subTitle ? 7 : 9"
              ></TextMax>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free12Style2',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style12.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax12.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
  indexs: {
    type: Number || String,
  },
});
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  position: relative;
  margin-left: 40px;
  margin-top: 0;
  height: 100%;
}
.content-parent {
  display: flex;
  position: relative;
  width: 730px;
  height: 774px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.digitalShowroom-p {
  display: flex;
  position: absolute;
  top: 20px;
  right: 249px;
  z-index: 15;
  width: 54px;
  height: 51px;
}
.content {
  display: flex;
  flex-direction: column;

  width: 730px;
  z-index: 6;
  position: relative;
  padding-right: 215px;
  padding-top: 100px;
}
.content2 {
  // .title-box {
  //   margin-top: calc(349px - 154px);
  // }
}
.content3 {
  // .title-box {
  //   margin-top: calc(316px - 154px);
  // }
  .subtitle {
    margin-top: calc(116px);
  }
}
.title-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 495px;
  height: 92px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  margin-left: 2px;
  :deep(p) {
    width: 387px;
    font-family: Alimama DongFangDaKai;
    font-size: 24px;
    font-weight: 400;
    line-height: 36px;
    text-align: center;
    background: linear-gradient(90deg, #ffeabc 0%, #fec64b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.title-box-2 {
}
.content-right-no {
  width: 373px;
  height: 371.27px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  margin-top: 96px;
  margin-left: 70px;
  animation: swing1 600s infinite ease-in-out;
  transform-origin: center center; /* 设置旋转中心为顶部中心 */
}
@keyframes swing1 {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(14400deg);
  }
}
.content-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 273px;
  margin-top: 110px;
  margin-left: 126px;
}
.subtitle {
  width: 100%;
  font-family: PingFang SC;
  font-size: 18px;
  color: rgba(255, 227, 162, 1);
  line-height: 28px;
  text-align: center;
}

.img-box {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; 
  overflow: hidden;
  width: 273px; 
  height: 150px;
  background: rgba(197, 30, 29, 0.45);
  border: 1px solid rgba(189, 32, 37, 1);
  box-shadow: 5px 4px 4px 0px rgba(0, 0, 0, 0.11) inset;

  .outline-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: calc(100% - 2px);
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}
.img-box1 {
  height: 201px;
  margin-top: 0px;
}
.img-box2 {
  height: 227px;
  margin-top: 10px;
}
.img-box3 {
  height: 282px;
  margin-top: 0px;
}

.remarks1 {
  width: 257px;
  margin-top: 10px;
  :deep(.van-text-ellipsis) {
  }
}
.remarks2 {
  width: 257px;
  margin-top: 20px;
}
.remarks3 {
  width: 257px;
  margin-top: 0px;
}
</style>